package com.ete.service.entry.hardware

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.PrimaryKey
import com.ete.service.manager.ManagerConstant

/**
 * Author:LiXian
 * <p>
 * Desc:硬件信息表
 * Version:1.0
 * date 2024/1/12 13:33
 */
@Entity(tableName = "t_hardware_info")
class HardwareInfoEntry() {

    /**
     * 数据唯一标识
     */
    @PrimaryKey
    var serialNumber: String = ""

    /**
     * 设备名称
     */
    @ColumnInfo
    var name: String? = ""

    /**
     * 设备类型 1、主机 2、单机
     */
    @ColumnInfo
    var type: Int = ManagerConstant.UPLOAD_TYPE_HOST

    /**
     * 设备编号（硬件唯一值）
     */
    @ColumnInfo
    var deviceId: String = ""

    /**
     * 网络类型 0、无网络 1、蜂窝 2 WIFI
     */
    @ColumnInfo
    var networkType: Int = 0

    /**
     * 系统版本（安卓系统版本）
     */
    @ColumnInfo
    var osVersion: String = ""

    /**
     * 软件版本（app版本）
     */
    @ColumnInfo
    var appVersion: String = ""

    /**
     * 上一次关机时间 格式：2000-01-01 01:01:01
     */
    @ColumnInfo
    var offTime: String? = ""

    /**
     * 这一次开机时间 格式：2000-01-01 01:01:01
     */
    @ColumnInfo
    var onTime: String? = ""

    /**
     * 固件版本（安卓板子的固件版本）
     */
    @ColumnInfo
    var firmwareVersion: String = ""

    /**
     * 硬件版本（主机的硬件版本）
     */
    @ColumnInfo
    var hardwareVersion: String? = ""

    /**
     * 连接类型 1、 2.4G 2、BLE蓝牙 3、涂鸦 4、5.8G 99、其他
     */
    @ColumnInfo
    var connectType: Int = 0

    /**
     * 上传状态，是否已经上传, 0:未上传 , 1:已上传
     */
    @ColumnInfo
    var uploadState: Int = 0

    /**
     * 创建时间
     */
    @ColumnInfo
    var createTime: Long = 0

    @Ignore
    constructor(serialNumber: String, name: String, type: Int, deviceId: String,
                networkType: Int, osVersion: String, appVersion: String,
                offTime: String, onTime: String, firmwareVersion: String,
                hardwareVersion: String, connectType: Int, uploadState: Int,
                createTime: Long) : this() {
        this.serialNumber = serialNumber
        this.name = name
        this.type = type
        this.deviceId = deviceId
        this.networkType = networkType
        this.osVersion = osVersion
        this.appVersion = appVersion
        this.offTime = offTime
        this.onTime = onTime
        this.firmwareVersion = firmwareVersion
        this.hardwareVersion = hardwareVersion
        this.connectType = connectType
        this.uploadState = uploadState
        this.createTime = createTime
    }

    override fun toString(): String {
        return "HardwareInfoEntry(serialNumber='$serialNumber', name=$name, type=$type, deviceId='$deviceId', networkType=$networkType, osVersion='$osVersion', appVersion='$appVersion', offTime=$offTime, onTime=$onTime, firmwareVersion='$firmwareVersion', hardwareVersion=$hardwareVersion, connectType=$connectType, uploadState=$uploadState, createTime=$createTime)"
    }


}